#include<stdio.h>
int main()
{
	int n = 0, i = 0;
	double fac = 0.0, sum = 0.0;
	for (n = 1;n <= 20;n++)
	{
		i = 1; fac = 1;
		do
		{
			fac = fac * i;
			i++;
		} while (i <= n);
		sum = sum + fac;
	}
	printf("sum=%le\n", sum);
	return 0;
}